using derivatives to draw graphs